package com.ease.framework.gef {
   import com.ease.common.models.IModel;
   import com.ease.common.models.IModelChangeListener;
   import com.ease.framework.figures.IFigure;
   import com.ease.framework.workbench.spi.ICommand;

   import flash.geom.Point;
   import flash.ui.ContextMenu;
   import flash.ui.ContextMenuItem;

   /**
    * EditPart表示控制器，用于响应model的变更，刷新Figure图元.
    *
    * @author James Hu
    *
    */
   public interface IEditPart extends IModelChangeListener {
      function get model():IModel;

      function createFigure():void;

      function removeFigure():void;

      /**
       * 此方法仅根据当前model，刷性当前的figure.
       */
      function refreashFigure():void;

      /**
       * 此方法一般是在根据 model重新创建figure的时候使用.
       *
       */
      function reloadFigure():void;

      /**
       * 比方法主要用于根据实例状态渲染图形.
       */
      function renderFigure():void;

      function get figure():IFigure;

      /**
       * 此方法主要是根据model重新进行reload figure.
       *
       * 在reload之前，会讲所有的child editpart及对应的figure删除，并进行重新创建和刷新.
       * 此加载会影响 child editpart.
       */
      function reload():void;

      function remove():void;

      function unremove():void;

//		function getContextMenu():ContextMenu;

      function createCustomContextMenuItems():void;

      function pushCustomContextMenuItem(item:ContextMenuItem):void;

      function createNewCommand(pool:IModel, parent:IModel = null, point:Point = null):ICommand;

      function createEditCommand(newModel:IModel):ICommand;

      function createRemoveCommand():ICommand;

      function createMoveResizeCommand(gap_x:Number, gap_y:Number, gap_width:Number, gap_height:Number):ICommand;

   }
}